/* component-states.css */

/* 基础面板样式 */
.component-test-panel {
    width: 280px;
    height: 100%;
    background: #82a4b0;
    padding: 0px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* 头部样式 */
.panel-header {
    padding: 2px 4px;
    font-weight: 800;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    pointer-events: auto !important;
}

.test-mode-switch {
    display: flex;
    align-items: center;
    justify-content: flex;
    gap: 12px;
    font-size: 11px;
}

#test-panel-logo {
    /* 移除 margin-top: auto */
    width: 100%;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container {
    width: min(140px, 80%); /* 响应式宽度 */
    max-height: 140px;
    aspect-ratio: 1;
}

/* 开关按钮 */
.switch-container {
    width: 28px;
    height: 14px;
    position: relative;
    cursor: pointer;
}

.switch-button {
    width: 28px;
    height: 14px;
    background: #e2e8f0;
    border-radius: 7px;
    transition: all 0.3s;
    cursor: pointer;
    position: absolute;
}

.switch-button.active {
    background: #3b82f6;
}

.switch-button::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.switch-button.active::after {
    transform: translateX(14px);
}

/* 测试模式状态 */
.component-test-panel:not(.test-mode) {
    pointer-events: none;
    opacity: 0.8;
}

/* 1. 首先保持测试模式的全局控制 */
.component-test-panel:not(.test-mode) .test-groups-container {
    pointer-events: none;
    opacity: 0.8;
}

/* 2. 确保以下元素不受测试模式影响 */
.panel-header,
#test-panel-logo {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* section 容器通用样式 */
.test-section {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1px;
}

.section-title {
    padding: 0px 4px;
    font-size: 11px;
    font-weight: 800;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border-radius: 6px 6px 0 0;
    height: 10px;  /* 固定标题高度 */
    line-height: 10px;  /* 确保文字垂直居中 */
}

/* 子组容器 */
.test-subgroups-container {
    padding: 0px;
}

.test-subgroup {
    padding: 1px 4px;
    border-bottom: 1px solid #e2e8f0;
    min-height: 14px;  /* 设置最小高度 */
}

.test-subgroup:last-child {
    border-bottom: none;
}

.subgroup-content {
    display: flex;
    align-items: center;
    padding: 0px;
    gap: 2px;
    height: 35px;
}

.subgroup-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    min-width: 40px;
}

/* 测试项列表 */
.test-list {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 4px;  /* 垂直间距更小 */
}

/* 控制项样式 */
.test-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 18px;
}

/* 按钮样式 */
.test-button {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 18px;
    padding: 0 4px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 11px;
    background: #fff;
    white-space: nowrap;
    min-width: 40px;
}

.test-button:hover {
    background: #f1f5f9;
}

.test-button.active {
    background: #3b82f6;
    color: #fff;
}

/* 输入控制 */
.value-control {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.value-input {
    width: 30px;
    height: 16px;
    padding: 0 2px;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    text-align: right;
    font-size: 11px;
}

/* 特殊组件样式覆盖 */
[data-group="sensors"] [data-subgroup="ir"] .test-button {
    min-width: 32px;
    padding: 0 2px;
}

[data-group="drive"] .subgroup-label {
    width: 45px;
}

[data-group="sensors"] [data-subgroup="cameras"] .test-list,
[data-group="sensors"] [data-subgroup="lidar"] .test-list {
    flex-direction: column;
    gap: 2px;
}

[data-group="sensors"] [data-subgroup="lidar"] .test-list > div:nth-child(n+3) {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 4px;
}